
#include <stdlib.h>
#include <stdio.h>
#include <memory.h>
#include "extmem.h"
void sortFirst(Buffer *buf,int readOffset,int length,int *wf,int groupSize);
int writeData(int *rp,int *wp,unsigned char *rblk,unsigned char *w1,int *wf,Buffer *buf);
int getValueByp(int *X,int *Y,int p,unsigned char *blk);
int judgeSmall(int *ovflag,int *X,int size);
void changePlace(unsigned char *blk,int p1,int p2);
void blkSort(unsigned char *blk);
char* itoa(int num,char *s);
void sortSecond(int *blkNo,int groupSize,int groupNum,int length,int *wf,Buffer *buf);
void sortBlocks(int rfStart,int wf,int groupSize,int length,Buffer *buf);